<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data> 
		<record id="view_quotation_line_form_bf" model="ir.ui.view">
			<field name="name">view.quotation.line.form.bf</field>
			<field name="model">param.create.invoice.analytic</field>
			<field name="arch" type="xml">
				<form string="Create Invoice">
					<group>
						<field name="journal_id" domain="[('type','=','sale')]"/>
						<field name="date_invoice"/>
						<field name="exchange_rate"/>
						<field name="billing_type" invisible="1"/>
					</group>
					<notebook colspan="4">
						<page string="Shipyard">
							<separator string="To be Invoiced Labour"/>
							<group>
								<group>
		                        	<field name="ship_normal_product_id" readonly="1"/>
		                        	<field name="ship_actual_normal_hours" on_change="onchange_ship_actual_normal_qty(billing_type, real_ship_actual_normal_hours, ship_actual_normal_hours)"/>
		                        	<field name="ship_ot_product_id" readonly="1"/>
		                        	<field name="ship_actual_ot_hours" on_change="onchange_ship_actual_ot_qty(billing_type, real_ship_actual_ot_hours, ship_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_ship_actual_normal_hours" readonly="1"/>
									<field name="ship_normal_price"/>
									<field name="real_ship_actual_ot_hours" readonly="1"/>
									<field name="ship_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="ship_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Shipyard Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="ship_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Shipyard Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Mechanical">
							<separator string="To be Invoiced Labour"/>
							<group>
								<group>
		                        	<field name="mech_normal_product_id" readonly="1"/>
		                        	<field name="mech_actual_normal_hours" on_change="onchange_mech_actual_normal_qty(billing_type, real_mech_actual_normal_hours, mech_actual_normal_hours)"/>
		                        	<field name="mech_ot_product_id" readonly="1"/>
		                        	<field name="mech_actual_ot_hours" on_change="onchange_mech_actual_ot_qty(billing_type, real_mech_actual_ot_hours, mech_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_mech_actual_normal_hours" readonly="1"/>
									<field name="mech_normal_price"/>
									<field name="real_mech_actual_ot_hours" readonly="1"/>
									<field name="mech_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="mech_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Mechanical Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="mech_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Mechanical Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Electrical">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="elec_normal_product_id" readonly="1"/>
		                        	<field name="elec_actual_normal_hours" on_change="onchange_elec_actual_normal_qty(billing_type, real_elec_actual_normal_hours, elec_actual_normal_hours)"/>
		                        	<field name="elec_ot_product_id" readonly="1"/>
		                        	<field name="elec_actual_ot_hours" on_change="onchange_elec_actual_ot_qty(billing_type, real_elec_actual_ot_hours, elec_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_elec_actual_normal_hours" readonly="1"/>
									<field name="elec_normal_price"/>
									<field name="real_elec_actual_ot_hours" readonly="1"/>
									<field name="elec_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="elec_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Electrical Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="elec_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Electrical Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Welding &amp; Fabrication">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="weld_normal_product_id" readonly="1"/>
		                        	<field name="weld_actual_normal_hours" on_change="onchange_weld_actual_normal_qty(billing_type, real_weld_actual_normal_hours, weld_actual_normal_hours)"/>
		                        	<field name="weld_ot_product_id" readonly="1"/>
		                        	<field name="weld_actual_ot_hours" on_change="onchange_weld_actual_ot_qty(billing_type, real_weld_actual_ot_hours, weld_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_weld_actual_normal_hours" readonly="1"/>
									<field name="weld_normal_price"/>
									<field name="real_weld_actual_ot_hours" readonly="1"/>
									<field name="weld_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="weld_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Welding &amp; Fabrication Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="weld_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Welding &amp; Fabrication Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Interior">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="int_normal_product_id" readonly="1"/>
		                        	<field name="int_actual_normal_hours" on_change="onchange_int_actual_normal_qty(billing_type, real_int_actual_normal_hours, int_actual_normal_hours)"/>
		                        	<field name="int_ot_product_id" readonly="1"/>
		                        	<field name="int_actual_ot_hours" on_change="onchange_int_actual_ot_qty(billing_type, real_int_actual_ot_hours, int_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_int_actual_normal_hours" readonly="1"/>
									<field name="int_normal_price"/>
									<field name="real_int_actual_ot_hours" readonly="1"/>
									<field name="int_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="int_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Interior Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="int_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Interior Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Design">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="desg_normal_product_id" readonly="1"/>
		                        	<field name="desg_actual_normal_hours" on_change="onchange_desg_actual_normal_qty(billing_type, real_desg_actual_normal_hours, desg_actual_normal_hours)"/>
		                        	<field name="desg_ot_product_id" readonly="1"/>
		                        	<field name="desg_actual_ot_hours" on_change="onchange_desg_actual_ot_qty(billing_type, real_desg_actual_ot_hours, desg_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_desg_actual_normal_hours" readonly="1"/>
									<field name="desg_normal_price"/>
									<field name="real_desg_actual_ot_hours" readonly="1"/>
									<field name="desg_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="desg_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Design Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="desg_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Design Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Other Dept1">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="dept1_normal_product_id" readonly="1"/>
		                        	<field name="dept1_actual_normal_hours" on_change="onchange_dept1_actual_normal_qty(billing_type, real_dept1_actual_normal_hours, dept1_actual_normal_hours)"/>
		                        	<field name="dept1_ot_product_id" readonly="1"/>
		                        	<field name="dept1_actual_ot_hours" on_change="onchange_dept1_actual_ot_qty(billing_type, real_dept1_actual_ot_hours, dept1_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_dept1_actual_normal_hours" readonly="1"/>
									<field name="dept1_normal_price"/>
									<field name="real_dept1_actual_ot_hours" readonly="1"/>
									<field name="dept1_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="dept1_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept1 Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="dept1_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept1 Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Other Dept2">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="dept2_normal_product_id" readonly="1"/>
		                        	<field name="dept2_actual_normal_hours" on_change="onchange_dept2_actual_normal_qty(billing_type, real_dept2_actual_normal_hours, dept2_actual_normal_hours)"/>
		                        	<field name="dept2_ot_product_id" readonly="1"/>
		                        	<field name="dept2_actual_ot_hours" on_change="onchange_dept2_actual_ot_qty(billing_type, real_dept2_actual_ot_hours, dept2_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_dept2_actual_normal_hours" readonly="1"/>
									<field name="dept2_normal_price"/>
									<field name="real_dept2_actual_ot_hours" readonly="1"/>
									<field name="dept2_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="dept2_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept2 Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="dept2_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept2 Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
						<page string="Other Dept3">
							<separator string="To be Invoiced Labour"/>
							<group>
		                        <group>
		                        	<field name="dept3_normal_product_id" readonly="1"/>
		                        	<field name="dept3_actual_normal_hours" on_change="onchange_dept3_actual_normal_qty(billing_type, real_dept3_actual_normal_hours, dept3_actual_normal_hours)"/>
		                        	<field name="dept3_ot_product_id" readonly="1"/>
		                        	<field name="dept3_actual_ot_hours" on_change="onchange_dept3_actual_ot_qty(billing_type, real_dept3_actual_ot_hours, dept3_actual_ot_hours)"/>
		                        </group>
		                        <group>
		                        	<field name="real_dept3_actual_normal_hours" readonly="1"/>
									<field name="dept3_normal_price"/>
									<field name="real_dept3_actual_ot_hours" readonly="1"/>
									<field name="dept3_ot_price"/>
	                        	</group>
	                        </group>
							<separator string="To be Invoiced Materials"/>
							<group>
								<field name="dept3_inv_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept3 Invoice Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="product_qty" invisible="1"/>
			                           	<field name="product_uom"/>
			                           	<field name="unit_price" />
			                           	<field name="real_qty" invisible="1"/>
			                           	<field name="generated_qty"/>
			                           	<field name="process_qty" on_change="onchange_process_qty(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_product_uom"  on_change="onchange_product_uom(product_uom, generated_qty, product_id, process_qty, sel_product_uom, unit_price)"/>
			                        	<field name="sel_unit_price"/>
			                        </tree>
		                         </field>
							</group>
							<separator string="To be Invoiced Services"/>
							<group>
								<field name="dept3_service_line_ids" colspan="4" nolabel="1" height="140">
			                        <tree string="Dept3 Invoice Service Lines" create="false" editable="bottom">
			                           	<field name="product_id"/>
			                           	<field name="real_product_qty"/>
			                           	<field name="product_qty" on_change="onchange_product_qty(real_product_qty, product_qty)"/>
			                           	<field name="unit_price"/>
			                        </tree>
		                        </field>
							</group>
						</page>
					</notebook>
					<footer>
	                    <button name="generate_analytic_invoice" string="Create Invoice" type="object" default_focus="1" class="oe_highlight"/>
	                    or 
	                    <button string="Cancel" class="oe_link" special="cancel"/>
	                </footer>
				</form>
			</field>
		</record>
		
		<record id="create_invoice_analytic" model="ir.actions.act_window">
			<field name="name">Create Invoice</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">param.create.invoice.analytic</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_quotation_line_form_bf"/>
			<field name="target">new</field>
 			<field name="multi">True</field>
		</record>
		
	</data>
</openerp>


